﻿@using UnityWeb.Models.UserReport
@using UnityWeb.Resources.UserReports
@model UnityWeb.Models.UserReport.UserReportsViewModel

@{
  ViewBag.Title = UserReport.Title;
}

<section>
  <h2 class="header">@UserReport.Title</h2>
  <input class="filterbtnReport" type="button" title="Run" value="Export User Report" onclick="location.href='@Url.Action("Run", "UserReports")  '" />
  <br />
  <br />
  <section class="accordion">
    <section class="pane">
      <table>
        <thead>
          <tr>
            <th style="width:20%;">USERNAME</th>
            <th class="txtcentre" style="width:20%;">USER ROLE</th>
            <th class="txtcentre" style="width:20%;">LOCKED</th>
            <th class="txtcentre" style="width:20%;">ACTIVE</th>
            <th class="txtright" style="width:20%;">LAST LOGIN DATE</th>
          </tr>
        </thead>
        <tbody>
          @foreach (UserReportViewModel userReportsViewModel in Model.Users)
          {
            <tr>
              <td colspan="6">
                <table class="subtable">
                  <thead>
                    <tr>
                      <th class="odd" style="width:20%;">@userReportsViewModel.UserName</th>
                      <th class="odd txtcentre" style="width:20%;">@userReportsViewModel.Roles</th>
                      <th class="odd txtcentre" style="width:20%;">@userReportsViewModel.IsLockedOut</th>
                      <th class="odd txtcentre" style="width:20%;">@userReportsViewModel.IsApproved</th>
                      <th class="odd txtright" style="width:20%;">@userReportsViewModel.LastLogin</th>
                    </tr>
                  </thead>
                </table>
              </td>
            </tr>
          }
        </tbody>
      </table>
    </section>
  </section>
</section>
<div id="userReportPager" class="pager">
  @Html.Pager(Model.PagingInfo.ItemsPerPage, Model.PagingInfo.CurrentPage, Model.PagingInfo.TotalItems)
</div>
<div class="clearfix"></div>
